<?php

/**
 * chambre actions.
 *
 * @package    app_clinique
 * @subpackage chambre
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2288 2006-10-02 15:22:13Z fabien $
 */
class chambreActions extends autochambreActions
{
    public function executeEdit()
  {
    $this->sf_chambre = $this->getsfChambreOrCreate();

    if ($this->getRequest()->getMethod() == sfRequest::POST)
    {
      $this->updatesfChambreFromRequest();

      $this->savesfChambre($this->sf_chambre);

      $this->setFlash('notice', "L'enregistrement a été effectué");

      if ($this->getRequestParameter('save_and_add'))
      {
        return $this->redirect('chambre/create');
      }
      else if ($this->getRequestParameter('save_and_list'))
      {
        return $this->redirect('chambre/list');
      }
      else
      {
        return $this->redirect('chambre/edit?id='.$this->sf_chambre->getId());
      }
    }
    else
    {
      $this->labels = $this->getLabels();
    }
  }
}
